<template>
  <div class="reincarnation">
    <!-- 页面头部区域 -->
    <div class="reincarnation-header">
      <div class="header-content">
        <div class="ancient-title">轮回转世系统</div>
        <div class="header-subtitle">六道轮回 · 因果业报 · 生死轮转</div>
      </div>
      <div class="header-decoration">
        <div class="decoration-line"></div>
        <div class="decoration-symbol">⚇</div>
        <div class="decoration-line"></div>
      </div>
    </div>

    <!-- 核心统计卡片 -->
    <div class="stats-section">
      <a-row :gutter="[20, 20]" class="stats-grid">
        <a-col :xs="24" :sm="12" :xl="6">
          <div class="stat-card primary-stat clickable" @click="navigateToStatistics">
            <div class="stat-icon">
              <ReloadOutlined />
            </div>
            <div class="stat-content">
              <div class="stat-title">轮回总数</div>
              <div class="stat-value">{{ reincarnationStats.totalCount?.toLocaleString() }}</div>
              <div class="stat-label">累计转世</div>
            </div>
          </div>
        </a-col>

        <a-col :xs="24" :sm="12" :xl="6">
          <div class="stat-card waiting-stat clickable" @click="navigateToJudgment">
            <div class="stat-icon">
              <ClockCircleOutlined />
            </div>
            <div class="stat-content">
              <div class="stat-title">排队等候</div>
              <div class="stat-value">{{ reincarnationStats.waitingQueue }}</div>
              <div class="stat-label">待投胎</div>
            </div>
          </div>
        </a-col>

        <a-col :xs="24" :sm="12" :xl="6">
          <div class="stat-card today-stat clickable" @click="navigateToHistory">
            <div class="stat-icon">
              <CalendarOutlined />
            </div>
            <div class="stat-content">
              <div class="stat-title">今日转世</div>
              <div class="stat-value">{{ reincarnationStats.todayCount }}</div>
              <div class="stat-label">已完成</div>
            </div>
          </div>
        </a-col>

        <a-col :xs="24" :sm="12" :xl="6">
          <div class="stat-card rule-stat clickable" @click="navigateToRules">
            <div class="stat-icon">
              <SettingOutlined />
            </div>
            <div class="stat-content">
              <div class="stat-title">活跃规则</div>
              <div class="stat-value">{{ reincarnationStats.activeRules }}</div>
              <div class="stat-label">运行中</div>
            </div>
          </div>
        </a-col>
      </a-row>
    </div>

    <!-- 主要内容区域 -->
    <div class="main-content">
      <a-row :gutter="[32, 32]" class="content-grid">
        <!-- 左侧主要内容 -->
        <a-col :xs="24" :lg="15">
          <div class="main-panel">
            <!-- 六道轮回分布 -->
            <div class="section-wrapper">
              <div class="section-header">
                <h3 class="section-title">
                  <GlobalOutlined class="section-icon" />
                  六道轮回分布
                </h3>
                <a-button type="link" class="section-action" @click="navigateToStatistics">查看详情</a-button>
              </div>

              <div class="realm-distribution">
                <div v-for="realm in sixRealms" :key="realm.id" class="realm-card">
                  <div class="realm-icon" :style="{ backgroundColor: realm.color }">
                    {{ realm.icon }}
                  </div>
                  <div class="realm-info">
                    <div class="realm-name">{{ realm.name }}</div>
                    <div class="realm-count">{{ realm.count?.toLocaleString() }}灵</div>
                    <div class="realm-percentage">{{ realm.percentage }}%</div>
                  </div>
                  <div class="realm-progress">
                    <div
                      class="progress-bar"
                      :style="{
                        width: realm.percentage + '%',
                        backgroundColor: realm.color
                      }"
                    ></div>
                  </div>
                </div>
              </div>
            </div>

            <!-- 待审案件列表 -->
            <div class="section-wrapper">
              <div class="section-header">
                <h3 class="section-title">
                  <FileTextOutlined class="section-icon" />
                  待审转世案件
                </h3>
                <a-button type="link" class="section-action" @click="navigateToJudgment">查看全部</a-button>
              </div>

              <div class="case-list">
                <div v-for="case_ in pendingCases" :key="case_.id" class="case-item">
                  <div class="case-avatar">
                    <a-avatar :style="{ backgroundColor: getKarmaColor(case_.karma) }" size="large">
                      {{ case_.name.charAt(0) }}
                    </a-avatar>
                  </div>
                  <div class="case-content">
                    <div class="case-header">
                      <span class="case-name">{{ case_.name }}</span>
                      <a-tag :color="getPriorityColor(case_.priority)" size="small">{{ case_.priority }}</a-tag>
                    </div>
                    <div class="case-description">业力值：{{ case_.karma }} | 申请转入：{{ case_.targetRealm }}</div>
                    <div class="case-meta">
                      <span class="case-time">排队时间：{{ case_.waitTime }}</span>
                      <a-button type="text" size="small" @click="handleCase(case_)" class="case-action"> 审理案件 </a-button>
                    </div>
                  </div>
                </div>
              </div>
            </div>

            <!-- 最近转世记录 -->
            <div class="section-wrapper">
              <div class="section-header">
                <h3 class="section-title">
                  <HistoryOutlined class="section-icon" />
                  最近转世记录
                </h3>
                <a-button type="link" class="section-action" @click="navigateToHistory">历史记录</a-button>
              </div>

              <div class="recent-records">
                <div v-for="record in recentRecords" :key="record.id" class="record-item">
                  <div class="record-dot" :style="{ backgroundColor: getRealmColor(record.toRealm) }">
                    {{ getRealmIcon(record.toRealm) }}
                  </div>
                  <div class="record-content">
                    <div class="record-title">{{ record.name }} 转世至 {{ record.toRealm }}</div>
                    <div class="record-description">前世：{{ record.fromRealm }} | 业力：{{ record.karma }} | 轮回第{{ record.cycle }}世</div>
                    <div class="record-time">{{ record.time }}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </a-col>

        <!-- 右侧侧边栏 -->
        <a-col :xs="24" :lg="9">
          <div class="sidebar-panel">
            <!-- 功能导航 -->
            <div class="section-wrapper compact">
              <div class="section-header">
                <h3 class="section-title">
                  <AppstoreOutlined class="section-icon" />
                  功能模块
                </h3>
              </div>

              <div class="module-nav">
                <div class="nav-card" @click="navigateToRules">
                  <div class="nav-icon rules">
                    <SettingOutlined />
                  </div>
                  <div class="nav-content">
                    <div class="nav-title">转世规则管理</div>
                    <div class="nav-desc">六道轮回规则 · 业力等级对应</div>
                  </div>
                </div>

                <div class="nav-card" @click="navigateToHistory">
                  <div class="nav-icon history">
                    <HistoryOutlined />
                  </div>
                  <div class="nav-content">
                    <div class="nav-title">轮回历史记录</div>
                    <div class="nav-desc">前世今生关系 · 修行进度跟踪</div>
                  </div>
                </div>

                <div class="nav-card" @click="navigateToArrangement">
                  <div class="nav-icon arrangement">
                    <CalendarOutlined />
                  </div>
                  <div class="nav-content">
                    <div class="nav-title">投胎安排管理</div>
                    <div class="nav-desc">家庭选择 · 时间地点分配</div>
                  </div>
                </div>
              </div>
            </div>

            <!-- 投胎安排预览 -->
            <div class="section-wrapper compact">
              <div class="section-header">
                <h3 class="section-title">
                  <CalendarOutlined class="section-icon" />
                  今日投胎安排
                </h3>
              </div>

              <div class="arrangements">
                <div v-for="arrangement in todayArrangements" :key="arrangement.id" class="arrangement-item">
                  <div class="arrangement-time">{{ arrangement.time }}</div>
                  <div class="arrangement-info">
                    <div class="arrangement-name">{{ arrangement.name }}</div>
                    <div class="arrangement-detail">{{ arrangement.realm }} · {{ arrangement.location }}</div>
                  </div>
                  <div class="arrangement-status" :class="arrangement.status">
                    {{ arrangement.statusText }}
                  </div>
                </div>
              </div>
            </div>

            <!-- 轮回统计概览 -->
            <div class="section-wrapper compact">
              <div class="section-header">
                <h3 class="section-title">
                  <BarChartOutlined class="section-icon" />
                  本月统计
                </h3>
              </div>

              <div class="month-stats">
                <div class="stat-item">
                  <div class="stat-label">转世总数</div>
                  <div class="stat-value highlight">{{ monthStats.totalReincarnations }}</div>
                </div>
                <div class="stat-item">
                  <div class="stat-label">平均等候</div>
                  <div class="stat-value">{{ monthStats.averageWaitTime }}</div>
                </div>
                <div class="stat-item">
                  <div class="stat-label">善转率</div>
                  <div class="stat-value success">{{ monthStats.goodReincarnationRate }}%</div>
                </div>
                <div class="stat-item">
                  <div class="stat-label">恶转率</div>
                  <div class="stat-value warning">{{ monthStats.badReincarnationRate }}%</div>
                </div>
              </div>
            </div>

            <!-- 系统监控 -->
            <div class="section-wrapper compact">
              <div class="section-header">
                <h3 class="section-title">
                  <DashboardOutlined class="section-icon" />
                  系统状态
                </h3>
              </div>

              <div class="system-monitor">
                <div class="monitor-item">
                  <div class="monitor-label">轮回通道</div>
                  <div class="monitor-status">
                    <a-badge status="processing" />
                    <span>运行正常</span>
                  </div>
                </div>
                <div class="monitor-item">
                  <div class="monitor-label">奈何桥状态</div>
                  <div class="monitor-status">
                    <a-badge status="success" />
                    <span>畅通无阻</span>
                  </div>
                </div>
                <div class="monitor-item">
                  <div class="monitor-label">孟婆汤库存</div>
                  <div class="monitor-value warning">{{ systemMonitor.mengpoSoupStock }} 碗</div>
                </div>
                <div class="monitor-item">
                  <div class="monitor-label">三生石记录</div>
                  <div class="monitor-value">{{ systemMonitor.threeLifeStone }} 条</div>
                </div>
              </div>
            </div>
          </div>
        </a-col>
      </a-row>
    </div>
  </div>
</template>

<script setup>
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { ReloadOutlined, ClockCircleOutlined, CalendarOutlined, SettingOutlined, GlobalOutlined, FileTextOutlined, HistoryOutlined, AppstoreOutlined, BarChartOutlined, DashboardOutlined } from '@ant-design/icons-vue'

// 路由
const router = useRouter()

// 轮回统计数据
const reincarnationStats = ref({
  totalCount: 8876543,
  waitingQueue: 1234,
  todayCount: 89,
  activeRules: 24
})

// 六道轮回分布数据
const sixRealms = ref([
  {
    id: 1,
    name: '天道',
    count: 234567,
    percentage: 8.5,
    color: '#f59e0b',
    icon: '☆'
  },
  {
    id: 2,
    name: '人道',
    count: 5234567,
    percentage: 58.9,
    color: '#10b981',
    icon: '♂'
  },
  {
    id: 3,
    name: '阿修罗道',
    count: 456789,
    percentage: 5.1,
    color: '#8b5cf6',
    icon: '⚔'
  },
  {
    id: 4,
    name: '畜生道',
    count: 1876543,
    percentage: 21.1,
    color: '#f97316',
    icon: '🐾'
  },
  {
    id: 5,
    name: '饿鬼道',
    count: 456234,
    percentage: 5.1,
    color: '#06b6d4',
    icon: '👻'
  },
  {
    id: 6,
    name: '地狱道',
    count: 123456,
    percentage: 1.3,
    color: '#ef4444',
    icon: '🔥'
  }
])

// 待审案件
const pendingCases = ref([
  {
    id: 1,
    name: '张三',
    karma: 85,
    targetRealm: '人道',
    priority: '紧急',
    waitTime: '3天'
  },
  {
    id: 2,
    name: '李四',
    karma: 92,
    targetRealm: '天道',
    priority: '高',
    waitTime: '1天'
  },
  {
    id: 3,
    name: '王五',
    karma: 45,
    targetRealm: '畜生道',
    priority: '普通',
    waitTime: '5天'
  }
])

// 最近转世记录
const recentRecords = ref([
  {
    id: 1,
    name: '赵六',
    fromRealm: '人道',
    toRealm: '天道',
    karma: 95,
    cycle: 8,
    time: '10分钟前'
  },
  {
    id: 2,
    name: '孙七',
    fromRealm: '畜生道',
    toRealm: '人道',
    karma: 78,
    cycle: 12,
    time: '1小时前'
  },
  {
    id: 3,
    name: '周八',
    fromRealm: '人道',
    toRealm: '阿修罗道',
    karma: 32,
    cycle: 5,
    time: '2小时前'
  }
])

// 今日投胎安排
const todayArrangements = ref([
  {
    id: 1,
    time: '14:30',
    name: '吴九',
    realm: '人道',
    location: '江南富户',
    status: 'completed',
    statusText: '已完成'
  },
  {
    id: 2,
    time: '15:45',
    name: '郑十',
    realm: '天道',
    location: '南天门',
    status: 'processing',
    statusText: '进行中'
  },
  {
    id: 3,
    time: '16:20',
    name: '钱一',
    realm: '人道',
    location: '书香门第',
    status: 'pending',
    statusText: '待开始'
  }
])

// 本月统计
const monthStats = ref({
  totalReincarnations: 2467,
  averageWaitTime: '3.2天',
  goodReincarnationRate: 67.8,
  badReincarnationRate: 32.2
})

// 系统监控
const systemMonitor = ref({
  mengpoSoupStock: 856,
  threeLifeStone: 98765
})

// 导航方法
const navigateToRules = () => {
  console.log('🔧 点击了转世规则管理，准备跳转...')
  try {
    router.push('/reincarnation/rules')
    console.log('✅ 路由跳转成功')
  } catch (error) {
    console.error('❌ 路由跳转失败:', error)
  }
}

const navigateToHistory = () => {
  console.log('📚 点击了轮回历史记录，准备跳转...')
  try {
    router.push('/reincarnation/history')
    console.log('✅ 路由跳转成功')
  } catch (error) {
    console.error('❌ 路由跳转失败:', error)
  }
}

const navigateToArrangement = () => {
  console.log('📅 点击了投胎安排管理，准备跳转...')
  try {
    router.push('/reincarnation/arrangement')
    console.log('✅ 路由跳转成功')
  } catch (error) {
    console.error('❌ 路由跳转失败:', error)
  }
}

const navigateToStatistics = () => {
  try {
    router.push('/reincarnation/rules')
  } catch (error) {
    console.error('❌ 路由跳转失败:', error)
  }
}

const navigateToJudgment = () => {
  console.log('⚖️ 点击了待审案件查看全部，准备跳转...')
  try {
    router.push('/judgment')
    console.log('✅ 路由跳转成功')
  } catch (error) {
    console.error('❌ 路由跳转失败:', error)
  }
}

// 方法
const getPriorityColor = (priority) => {
  const colors = {
    紧急: 'red',
    高: 'orange',
    普通: 'blue'
  }
  return colors[priority] || 'default'
}

const getKarmaColor = (karma) => {
  if (karma >= 80) return '#52c41a'
  if (karma >= 60) return '#fa8c16'
  return '#ff4d4f'
}

const getRealmColor = (realm) => {
  const colors = {
    天道: '#f59e0b',
    人道: '#10b981',
    阿修罗道: '#8b5cf6',
    畜生道: '#f97316',
    饿鬼道: '#06b6d4',
    地狱道: '#ef4444'
  }
  return colors[realm] || '#666'
}

const getRealmIcon = (realm) => {
  const icons = {
    天道: '☆',
    人道: '♂',
    阿修罗道: '⚔',
    畜生道: '🐾',
    饿鬼道: '👻',
    地狱道: '🔥'
  }
  return icons[realm] || '●'
}

const handleCase = (case_) => {
  // 处理案件逻辑
  router.push('/judgment')
}
</script>

<style lang="scss" scoped>
.reincarnation {
  padding: 0;

  // 页面头部
  .reincarnation-header {
    text-align: center;
    margin-bottom: 48px;

    .header-content {
      .ancient-title {
        font-size: 32px;
        font-weight: bold;
        color: $secondary-color;
        margin-bottom: 8px;
        text-shadow: 0 0 20px rgba(212, 153, 10, 0.3);
      }

      .header-subtitle {
        font-size: 16px;
        color: $text-secondary;
        letter-spacing: 2px;
      }
    }

    .header-decoration {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 24px;
      gap: 16px;

      .decoration-line {
        width: 80px;
        height: 1px;
        background: linear-gradient(90deg, transparent, $secondary-color, transparent);
      }

      .decoration-symbol {
        font-size: 20px;
        color: $secondary-color;
        font-weight: bold;
      }
    }
  }

  // 统计卡片区域
  .stats-section {
    margin-bottom: 48px;

    .stats-grid {
      .stat-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 24px;
        height: 120px;
        display: flex;
        align-items: center;
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;

        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          height: 3px;
          background: linear-gradient(90deg, transparent, currentColor, transparent);
          opacity: 0.6;
        }

        &.primary-stat {
          color: $primary-color;
          border-color: rgba(114, 46, 209, 0.2);
        }

        &.waiting-stat {
          color: #fa541c;
          border-color: rgba(245, 84, 28, 0.2);
        }

        &.today-stat {
          color: #52c41a;
          border-color: rgba(82, 196, 26, 0.2);
        }

        &.rule-stat {
          color: $secondary-color;
          border-color: rgba(212, 153, 10, 0.2);
        }

        .stat-icon {
          font-size: 36px;
          margin-right: 20px;
          opacity: 0.8;
        }

        .stat-content {
          flex: 1;

          .stat-title {
            font-size: 14px;
            color: $text-secondary;
            margin-bottom: 8px;
            font-weight: 500;
          }

          .stat-value {
            font-size: 28px;
            font-weight: bold;
            color: currentColor;
            margin-bottom: 4px;
            line-height: 1;
          }

          .stat-label {
            font-size: 12px;
            color: $text-tertiary;
          }
        }

        &.clickable {
          cursor: pointer;

          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.25);

            .stat-icon {
              opacity: 1;
              transform: scale(1.1);
            }

            .stat-value {
              color: currentColor;
              text-shadow: 0 0 12px currentColor;
            }
          }

          &:active {
            transform: translateY(0);
            transition: transform 0.1s ease;
          }
        }
      }
    }
  }

  // 主要内容区域
  .main-content {
    .main-panel,
    .sidebar-panel {
      display: flex;
      flex-direction: column;
      gap: 32px;
    }

    // 通用区域样式
    .section-wrapper {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 16px;
      padding: 24px;
      backdrop-filter: blur(10px);

      &.compact {
        padding: 20px;
      }

      .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);

        .section-title {
          display: flex;
          align-items: center;
          font-size: 18px;
          font-weight: 600;
          color: $text-primary;
          margin: 0;

          .section-icon {
            font-size: 20px;
            margin-right: 12px;
            color: $primary-color;
          }
        }

        .section-action {
          color: $primary-color;
          padding: 0;
          height: auto;
          font-size: 14px;
        }
      }
    }

    // 六道轮回分布
    .realm-distribution {
      .realm-card {
        display: flex;
        align-items: center;
        padding: 16px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);

        &:last-child {
          border-bottom: none;
        }

        .realm-icon {
          width: 48px;
          height: 48px;
          border-radius: 12px;
          display: flex;
          align-items: center;
          justify-content: center;
          color: white;
          font-size: 20px;
          margin-right: 16px;
          flex-shrink: 0;
        }

        .realm-info {
          flex: 1;
          margin-right: 16px;

          .realm-name {
            font-size: 16px;
            font-weight: 600;
            color: $text-primary;
            margin-bottom: 4px;
          }

          .realm-count {
            font-size: 14px;
            color: $text-secondary;
            margin-bottom: 4px;
          }

          .realm-percentage {
            font-size: 12px;
            color: $text-tertiary;
          }
        }

        .realm-progress {
          width: 120px;
          height: 6px;
          background: rgba(255, 255, 255, 0.1);
          border-radius: 3px;
          overflow: hidden;

          .progress-bar {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s ease;
          }
        }
      }
    }

    // 案件列表
    .case-list {
      .case-item {
        display: flex;
        align-items: flex-start;
        padding: 16px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);

        &:last-child {
          border-bottom: none;
        }

        .case-avatar {
          margin-right: 16px;
          flex-shrink: 0;
        }

        .case-content {
          flex: 1;
          min-width: 0;

          .case-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;

            .case-name {
              font-size: 16px;
              font-weight: 500;
              color: $text-primary;
            }
          }

          .case-description {
            font-size: 14px;
            color: $text-secondary;
            margin-bottom: 12px;
            line-height: 1.4;
          }

          .case-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;

            .case-time {
              font-size: 12px;
              color: $text-tertiary;
            }

            .case-action {
              color: $primary-color;
              padding: 0;
              height: auto;
            }
          }
        }
      }
    }

    // 最近记录时间线
    .recent-records {
      .record-item {
        display: flex;
        align-items: flex-start;
        margin-bottom: 20px;

        &:last-child {
          margin-bottom: 0;
        }

        .record-dot {
          width: 32px;
          height: 32px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-right: 16px;
          flex-shrink: 0;
          color: white;
          font-size: 14px;
        }

        .record-content {
          flex: 1;
          padding-top: 2px;

          .record-title {
            font-size: 15px;
            font-weight: 500;
            color: $text-primary;
            margin-bottom: 4px;
          }

          .record-description {
            font-size: 13px;
            color: $text-secondary;
            margin-bottom: 6px;
            line-height: 1.4;
          }

          .record-time {
            font-size: 12px;
            color: $text-tertiary;
          }
        }
      }
    }

    // 功能导航
    .module-nav {
      .nav-card {
        display: flex;
        align-items: center;
        padding: 16px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        margin-bottom: 12px;
        cursor: pointer;
        transition: all 0.3s ease;

        &:last-child {
          margin-bottom: 0;
        }

        &:hover {
          background: rgba(114, 46, 209, 0.1);
          border-color: $primary-color;
          transform: translateY(-2px);
          box-shadow: 0 8px 25px rgba(114, 46, 209, 0.15);
        }

        &:active {
          transform: translateY(0);
          box-shadow: 0 4px 15px rgba(114, 46, 209, 0.1);
        }

        .nav-icon {
          width: 48px;
          height: 48px;
          border-radius: 12px;
          display: flex;
          align-items: center;
          justify-content: center;
          color: white;
          font-size: 20px;
          margin-right: 16px;
          flex-shrink: 0;

          &.rules {
            background: linear-gradient(135deg, #722ed1, #9254de);
          }

          &.history {
            background: linear-gradient(135deg, #1890ff, #40a9ff);
          }

          &.arrangement {
            background: linear-gradient(135deg, #52c41a, #73d13d);
          }
        }

        .nav-content {
          flex: 1;

          .nav-title {
            font-size: 16px;
            font-weight: 600;
            color: $text-primary;
            margin-bottom: 4px;
          }

          .nav-desc {
            font-size: 12px;
            color: $text-secondary;
            line-height: 1.4;
          }
        }
      }
    }

    // 投胎安排
    .arrangements {
      .arrangement-item {
        display: flex;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);

        &:last-child {
          border-bottom: none;
        }

        .arrangement-time {
          font-size: 14px;
          font-weight: 600;
          color: $primary-color;
          width: 60px;
          flex-shrink: 0;
        }

        .arrangement-info {
          flex: 1;
          margin: 0 12px;

          .arrangement-name {
            font-size: 14px;
            color: $text-primary;
            margin-bottom: 2px;
          }

          .arrangement-detail {
            font-size: 12px;
            color: $text-secondary;
          }
        }

        .arrangement-status {
          font-size: 12px;
          padding: 2px 8px;
          border-radius: 4px;

          &.completed {
            background: rgba(82, 196, 26, 0.2);
            color: #52c41a;
          }

          &.processing {
            background: rgba(24, 144, 255, 0.2);
            color: #1890ff;
          }

          &.pending {
            background: rgba(255, 255, 255, 0.1);
            color: $text-tertiary;
          }
        }
      }
    }

    // 月度统计
    .month-stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;

      .stat-item {
        text-align: center;
        padding: 16px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;

        .stat-label {
          font-size: 12px;
          color: $text-secondary;
          margin-bottom: 8px;
        }

        .stat-value {
          font-size: 16px;
          font-weight: 600;
          color: $text-primary;

          &.highlight {
            color: $primary-color;
          }

          &.success {
            color: #52c41a;
          }

          &.warning {
            color: #fa8c16;
          }
        }
      }
    }

    // 系统监控
    .system-monitor {
      .monitor-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);

        &:last-child {
          border-bottom: none;
        }

        .monitor-label {
          font-size: 14px;
          color: $text-secondary;
        }

        .monitor-status {
          display: flex;
          align-items: center;
          gap: 6px;

          span {
            font-size: 12px;
            color: $text-primary;
          }
        }

        .monitor-value {
          font-size: 14px;
          font-weight: 500;
          color: $text-primary;

          &.warning {
            color: #fa8c16;
          }
        }
      }
    }
  }
}

// 响应式适配
@media (max-width: 1200px) {
  .reincarnation {
    .stats-section .stats-grid {
      .stat-card {
        height: 100px;
        padding: 20px;

        .stat-icon {
          font-size: 28px;
          margin-right: 16px;
        }

        .stat-content .stat-value {
          font-size: 24px;
        }
      }
    }

    .main-content {
      .main-panel,
      .sidebar-panel {
        gap: 24px;
      }
    }
  }
}

@media (max-width: 768px) {
  .reincarnation {
    .reincarnation-header {
      margin-bottom: 32px;

      .header-content .ancient-title {
        font-size: 24px;
      }
    }

    .stats-section {
      margin-bottom: 32px;

      .stats-grid {
        .stat-card {
          height: 80px;
          padding: 16px;

          .stat-icon {
            font-size: 24px;
            margin-right: 12px;
          }

          .stat-content {
            .stat-value {
              font-size: 20px;
            }

            .stat-title {
              font-size: 12px;
            }
          }
        }
      }
    }

    .main-content {
      .section-wrapper {
        padding: 20px;
      }

      .month-stats {
        grid-template-columns: 1fr;
      }
    }
  }
}
</style>
